package com.example.demo1.controller;

import com.example.demo1.config.DBConnector;
import com.example.demo1.config.Dev;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DefaultControllor {
    @Autowired
    private Environment env;
     @RequestMapping("/getPort")
    public String getPort() {
         String port = env.getProperty("server.port");
         System.out.println("server.port:" + port);
         return "Welcome to Spring Boot Application!";
     }
     @Autowired
    private DBConnector dbConnector;
     @RequestMapping("/getDB")
    public void getDB() {
         dbConnector.configure();
     }
}
